package Cola;

/**
 * @Author Zhang Chao
 * @Date 2021/5/19 20:59
 * @Version 1.0
 * SalariedEmployee ： ColaEmployee 的子类，拿固定工资的员工。属性：月薪
 */
public class SalariedEmployee extends ColaEmployee{
     private double monSalary;//月薪

    public SalariedEmployee(String name,int month,double monSalary) {
        super(name,month);
        this.monSalary=monSalary;
    }

    //	方法：getSalary(int month) 根据参数月份来确定工资，
    //	如果该月员工过生日，则公司会额外奖励100 元。
    @Override
    public double getSalary(int month) {
        if (super.month==month) {
            return monSalary +100;
        }else {
            return monSalary;
        }

    }
}
